Collision monitoring system

ABSTRACT

Disclosed is an improved system and method for sensing both hard and soft obstructions for a movable panel such as a sunroof. A dual detection scheme is employing that includes an optical sensing as the primary means and electronic sensing of motor current as a secondary means. The secondary means utilizes system empirical precharacterization, fast processing algorithms, motor parameter monitoring including both current sensing and sensorless electronic motor current commutation pulse sensing, and controller memory, to adaptively modify electronic obstacle detection thresholds in real time without the use of templates and cycle averaging techniques.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of application Ser. No.10/100,892 which is a continuation-in-part of application Ser. No.09/562,986 filed May 1, 2000 which is a continuation-in-part ofapplication Ser. No. 08/736,786 to Boisvert et al. which was filed onOct. 25, 1996, now U.S. Pat. No. 6,064,165 which was a continuation ofU.S. application Ser. No. 08/275,107 to Boisvert et al. which was filedon Jul. 14, 1994 which is a continuation in part of application Ser. No.07/872,190 filed Apr. 22, 1992 to Washeleski et al., now U.S. Pat. No.5,334,876. These related applications are incorporated herein byreference. Applicants also incorporate by reference U.S. Pat. No.5,952,801 to Boisvert et al, which issued Sep. 14, 1999. Thisapplication also claims priority from U.S. Provisional application Ser.No. 60/169,061 filed Dec. 6, 1999 which is also incorporated herein byreference.

FIELD OF THE INVENTION

The present invention concerns motor driven actuator control systems andmethods whereby empirically characterized actuation operation parametersare subsequently monitored.

BACKGROUND

National Highway Traffic Safety Administration (NHTSA) Standard 118contains regulations to assure safe operation of power-operated windowsand roof panels. It establishes requirements for power window controlsystems located on the vehicle exterior and for remote control devices.The purpose of the standard is to reduce the risk of personal injurythat could result if a limb catches between a closing power operatedwindow and its window frame. Standard 118 states that maximum allowableobstacle interference force during an automatic closure is less than 100Newton onto a solid cylinder having a diameter from 4 millimeters to 200millimeters.

Certain technical difficulties exist with operation of prior artautomatic power window controls. One difficulty is undesirable shutdownof the power window control for causes other than true obstacledetection. Detection of obstacles during startup energization, softobstacle detection, and hard obstacle detection each present technicalchallenges requiring multiple simultaneous obstacle detectiontechniques. Additionally, the gasket area of the window that seals toavoid water seepage into the vehicle presents a difficulty to the designof a power window control, since the window panel encounterssignificantly different resistance to movement in this region. Operationunder varying power supply voltage results in actuator speed variationsthat result in increased obstacle detection thresholds.

SUMMARY OF THE INVENTION

This invention concerns an improved actuator system that provides fasteroperation, more sensitive obstacle detection, faster actuator stoppingwith reduced pinch force, and reduced false obstacle detection all withless costly hardware. This invention has utilization potential fordiverse automatic powered actuator applications including positioning ofdoors, windows, sliding panels, seats, control pedals, steering wheels,aerodynamic controls, hydrodynamic controls, and much more. Oneexemplary embodiment of primary emphasis for this disclosure concerns anautomatic powered actuator as a motor vehicle sunroof panel.

An exemplary system built in accordance with one embodiment of theinvention implements position and speed sensing is via electronic motorcurrent commutation pulse sensing of the drive motor. Motor currentcommutation pulse counting detection means and counting correctionroutines provide improved position and speed accuracy.

In one exemplary embodiment, stored empirical parametercharacterizations and algorithms adaptively modify obstacle detectionthresholds during an ongoing actuation for improved obstacle detectionsensitivity and thresholds resulting in quicker obstacle detection withlower initial force, lower final pinch force and reduced occurrences offalse obstacle detection.

An exemplary embodiment of the collision sensing system uses a memoryfor actuation speed measurement, motor current measurement, andcalculations of an ongoing actuation with real time adaptive algorithmsenables real time running adaptive compensation of obstacle detectionthresholds.

BRIEF DESCRIPTIONS OF THE DRAWINGS

FIG. 1 is a block diagram schematic of the components of an exemplaryembodiment of the present invention;

FIGS. 2A-2D are schematics of circuitry for controlling movement andsensing obstructions of a motor driven panel such as a motor vehiclesunroof;

FIG. 3A is a plan view depicting an optical sensing system formonitoring an obstruction in the pinch zone of a moving panel such as amotor vehicle sunroof;

FIG. 3B is a front elevation view of the FIG. 3A optical sensing system;

FIG. 3C is a plan view depicting an optical system with moving opticsfor monitoring an obstruction at the leading edge of a moving panel suchas a motor vehicle sunroof;

FIG. 3D is a front elevation view of the FIG. 3C optical sensing system;

FIG. 3E is a plan view depicting an optical sensing system with movingoptics, flexible optic fiber, remote IR emission, and remote IRdetection for monitoring an obstruction at the leading edge of a movingpanel such as a motor vehicle sunroof;

FIG. 4 represents typical startup energization characteristics of motorcurrent and per speed versus time;

FIG. 5 represents a simplified example of characteristic steady statenominal motor operation function versus time or position;

FIG. 6 represents a simplified example characteristic dynamic transientmotor operation function versus time and/or position showing motoroperation function with transients;

FIG. 7 represents a simplified example characteristic dynamic periodiccyclic motor operation function versus time and/or position showingmotor operation function with cyclic disturbances; and

FIG. 8 is a sequence of measurements taken by a controller duringsuccessive time intervals and operation of a monitored panel drivemotor.

BEST MODE FOR PRACTICING THE INVENTION

FIG. 1 shows a functional block diagram of an actuator safety feedbackcontrol system 1 for monitoring and controlling movement of a motordriven panel such as a motor vehicle sunroof. A panel movementcontroller 2 includes a commercially available multipurposemicrocontroller IC (integrated circuit) with internal and/or externalFIFO memory and/or RAM (Random Access Memory) 2 a and ADC(analog-to-digital-converter) 2 b.

Eight-bit word bytes, eight-bit counters, and eight-bitanalog-to-digital conversions are used with the exemplary controller 2.It should be fully realized, however, that alternative word lengths maybe more appropriate for systems requiring different parameterresolution. Larger word bytes with equivalent ADC resolution enablesgreater resolution for motor current sensing. Likewise, larger wordbytes with higher microcontroller clock speeds enable greater resolutionfor motor per speed sensing plus quicker digital signal processing andalgorithm processing for quicker response time.

A temperature sensor 3 (which according to the preferred embodiment ofthe invention is an option) when installed, is driven by and sensed bythe controller 2. Temperature sensing allows the panel controller 2 toautomatically sense vehicle cabin temperature and open or close thesunroof to help maintain a desired range of temperatures. Temperaturecompensation of actuator obstacle detection thresholds is typicallyunnecessary.

An optional rain sensor 4 can be both driven by and sensed by themicrocontroller 2. Automatic closing of the sunroof panel occurs whenthe sensor is wet. Subsequently, the sunroof panel can be opened wheneither falling rain has stopped for some time duration or when the rainhas evaporated to some extent.

Manual switch inputs 5 are the means by which operator control of thesystem occurs.

Limit switch inputs 6 indicate to the control system such physicalinputs as HOME position, VENT/NOT OPEN Quadrant Switch, and end of panelmovement. Limit switch signals indicate where microcontroller encoderpulse counter registers are set or reset representative of specificpanel position(s).

Motor drive outputs 7 a and 7 b control whether the motor drives thepanel in the forward or the reverse direction. When neither the forwardnor the reverse direction are driven, the motor drive terminals areelectrically shorted together, possibly via a circuit node such asCOMMON, resulting in an electrical loading and thus a dynamic brakingeffect.

Motor plugging drive, which is the application of reverse drive polaritywhile a motor is still rotating, is an optional method of more quicklystopping the motor, but has been unnecessary for use with the preferredembodiment of the sunroof panel controller due to satisfactoryperformance taught by this disclosure. Very large motor pluggingcurrents are often undesirable because they can easily exceed typicalmaximum stalled rotor currents producing undesired motor heating inlarge applications. Such high motor plugging currents can be detrimentalto the life and reliability of electromechanical relay contacts andsolid state switches used to switch motor operating currents. High motorplugging currents can also cause undesirable transients, trip breakers,and blow fuses in a power supply system.

Application of brakes and/or clutches is also unnecessary with theautomotive sunroof system due to the improved real time obstacledetection performance taught by this disclosure.

Optical Obstacle Detection

Obstacle detection by actual physical contact and/or pinch force withhuman subjects is somewhat unnerving to some individuals. For improvedsystem safety and user comfort, the preferred system utilizesnon-contact detection of obstacles in the path of the moving panel. Ofvarious technologies by which it is possible to sense an obstaclewithout physical contact, IR (infrared) emission with transmissioninterruption mode detection is preferred. IR emitting diodes and/or IRlaser diodes are the two preferred IR emission sources. IR photodiodesand/or IR phototransistors are the two preferred IR detection means.Optical obstacle detection senses and enables stopping of the actuatormovement prior to significant applied pinch force and possibly prior toactual physical contact with a subject. In unusual light conditions,explained below, optical sensing means becomes temporarily ineffective,thus obstacle detection via motor current sensing or current sensing andspeed sensing means becomes the remaining reliable backup method ofdetecting an obstacle.

Of two preferred configurations utilized for implementing IRtransmission interruption mode of obstacle detection, the first is useof at least one emitter and at least one detector sensing at leastacross the pinch zone in close proximity to an end of travel region of asunroof. As shown in FIGS. 3A and 3B, at least one IR emitter 100 and atleast one IR detector 102 are separated from each other by a sunroofpinch zone 104. In an exemplary embodiment of the invention, optosensing of obstructions is across and in relatively close proximity to apinch zone near the end of travel region of a sunroof. The depictions inFIGS. 3A and 3B do not show the entire region between emitter anddetector but it is appreciated that a gap G between emitter and detectoris on the order of the width of the moving sunroof. In this preferredembodiment, cabling 108 passes to the region of the detector 102 aroundthe end of the sunroof liner in the region of the end of the sunrooftravel. The detector and emitter are fixed to the sunroof liner and donot move. Implementation of this fixed configuration is simplified bylack of moving components, although the sunroof may have to push theobstacle into a sensing field between the emitter 100 and the detector102. Thus, although the sensing means is non-contact, the sunroof canstill contact the obstacle.

Of two preferred configurations utilized for implementing IRtransmission interruption obstacle detection, the second is use of atleast one emitter and at least one detector sensing at least immediatelyahead of the front moving edge of the moving portion of a sunroof. Asshown in FIGS. 3C and 3D, at least one IR emitter 100 and at least oneIR detector 102 are separated proximal a front moving edge of a sunroof103. In an exemplary embodiment of the invention, opto-sensing ofobstructions is across and in relatively close proximity to a front edge105 of the sunroof 103. The depictions in FIGS. 3C and 3D show theentire region between emitter and detector for which a gap G, betweenemitter and detector, is on the order of the width of the movingsunroof. In this preferred embodiment, flexible flat circuitry 107passes to the emitter 100 and the detector 102 of the moving panel orwindow to the region of the front moving edge. Alternate means to supplyelectrical signal and/or power to the moving opto-electronic componentsincludes means such as electrical contact brushes cooperating withconductive traces on the moving panel. Power and signal are optionallyboth transmitted over the same conductors. FIG. 3E shows an alternativemeans to supply IR emission to receive IR detection from the front edgeof the moving panel via flexible moving optic fiber 303 means connectedwith components 300, 302 that respectively emit IR and detect IRsignals. IR optical fibers are terminated at each end to opticalcomponents 304, 305 that perform collimating, reflecting, and focusingrequirements. The structure depicted in FIGS. 3A-3E make it possible tosense obstructions with no physical obstacle contact regardless of theposition of the moving sunroof.

Alternate, non-preferred means of obstacle detection include sensingback reflection from a reflective surface of radiation emitted from anemitter, electric field sensing of proximal material dielectricproperties, and magnetic field sensing of proximal material inductiveproperties.

Various techniques improve the operation and reliability of non-contactoptical detection sensing. In accordance with an exemplary embodiment ofthe present invention, the IR emitter 100 is driven with a duty cycleand frequency. One typical automobile sunroof application uses 20% dutycycle at 500 Hz IR emitter drive synchronized with IR detector sensing.Pulsed drive allows the IR emitter 100 to be driven harder during its ontime at a low average power. This harder drive yields improvedsignal-to-noise for IR sensing by the IR detector. The IR detectorcircuit synchronously compares the IR signal detected during IR emitteron times with IR emitter off times to determine ambient IR levels fordrive and signal compensation purposes. This allows the IR emitter to IRdetector optical coupling to be determined with a level of accuracy andreliability using closed loop feedback techniques.

Automatic gain feedback control techniques maintain the level of the IRemitter drive and/or the gain of the IR detector circuit so that opticalcoupling is above minimum desirable values. Such automatic gaincompensates, within certain limitations, factors including decrease inIR emitter output over accumulated time at temperature, IR emitteroutput temperature coefficient, dirt and haze fouling optic components,and high ambient IR levels.

Highly directional IR optical lenses and/or aligned polarized filters onboth the IR emitter and IR detector maintain better optical coupling andreduce the effects of ambient IR and reflected IR from other directions.Location of the IR detector in a physical recess further reduces thepossibility of extraneous IR “noise” from affecting the opticalcoupling.

Despite various means to reduce the possibility of excess extraneous IRfrom being detected, certain conditions occur that may allow very highlevels of direct and/or reflected sunlight to be “seen” by the detector.Sun IR power levels can saturate the detector output signal level sothat obstacle blockage of the pulsed IR emitter signals is not reliablysensed. Under such unusual “white out” circumstances, the IR opticalsystem is disabled by the panel controller 2 until the sunroof actuatoris nearly closed, at which position ambient IR noise is shielded by thesunroof. Thus, the complete emitter-detector IR coupling is made morereliable for the last movement of pinch point closure. Complete bodyblockage of the IR coupling path between the emitter and detector is nota “white out” condition, although if the body is blocking both ambientIR and emitted IR signal at the detector, a “black out” condition isinterpreted as an obstacle detection.

Although the IR obstacle detection means may be temporarily found to beunreliable by high ambient levels of IR, the disclosed sensing of hardand/or soft obstacles by motor current monitoring is always active as aredundant obstacle detection means.

Detailed Schematic

The controller schematic shown in FIGS. 2A-2D implements collisionsensing in one form by activating a light emitting diode 100 a whichemits at periodic intervals. In the event the infra red radiation is notsensed by a photo transistor detector 102 a, the controller 2 assumes anobstruction and deactivates the sunroof motor M. There is also aredundant and more reliable obstacle detection means for detectingobstacles based upon sensed motor operation parameters.

The preferred controller 2 is an Atmel 8 Bit microprocessor having 8Kilobytes of ROM and includes programming inputs 106 which can becoupled to an external data source and used to reprogram themicroprocessor controller 2. User controlled inputs 5 a, 5 b are coupledto user activated switches which are activated to control movement ofthe sunroof. The inputs are similar to now issued U.S. Pat. No.5,952,801 to Boisvert et al, which describes the functionality of thoseinputs. Limit switch outputs 5 c, 5 d, 5 e are also monitored by thecontroller 2 and used to control activation of the sunroof drive motor.

The schematic depicts a clock oscillator 110 for providing a clocksignal of 6 MHZ for driving the microprocessor controller 2. To theupper left of the oscillator is a decoupling capacitor circuit 112 fordecoupling a VCC power signal to the microprocessor.

The circuitry depicted in FIG. 2B provides power signals in response toinput of a high signal at the ignition input 114. When the ignitioninput goes high, this signal passes through a diode 116 to the baseinput 118 of a transistor 120 which turns on. When the transistor 120turns on, a regulated output of 5 volts (VCC) is provided by a voltageregulator 122 in the upper right hand corner of FIG. 2B. A voltage inputto the voltage regulator 122 is derived from two battery inputs 124, 126coupled through a filtering and reverse polarity protection circuit 130.Immediately above the positive battery input 124 is a relay output 131which provides a signal one diode drop less than battery voltage VBATwhich powers the relay coils 132, 134 (FIG. 2D) for activating themotor.

The circuitry of FIGS. 2A-2D includes a number of operational amplifierswhich require higher voltage than the five volt VCC logic circuitrypower signal. At the extreme right hand side of the schematic of FIG. 2Bare two transistors 136, 138 one of which includes a base 140 coupled toan output 142 from the microprocessor controller 2. The secondtransistor has its collector coupled to the battery and an output on theemitter designated V-SW. When the microprocessor turns on the transistor138, the V-SW output goes to battery voltage. The V-SW output isconnected to a voltage regulator (not shown) which generates a DC signalthat is supplied throughout the circuit for operation of the variousoperational amplifiers.

The microprocessor controller 2 also has two motor control outputs 150,152 which control two switching transistors 154, 156, which in turnenergize two relay coils 132, 134. The relay coils have contacts 162,164 coupled across the motor M for energizing the motor windings with abattery voltage VBAT. One or the other of the transistors must be turnedon in order to activate the motor. When one of the two transistors ison, the motor M rotates to provide output power at an output shaft formoving the sunroof or other panel along a path of travel in onedirection. To change the direction of the motor rotation, the firsttransistor is turned off and the second activated. The motor used todrive the sunroof panel back and forth along its path of travel in theexemplary embodiment of the present invention is a DC motor.

FIG. 2C depicts a circuit 180 for monitoring light emitting diodesignals. A light emitting diode 100 a has an anode connection 181coupled to the V-switched signal and the cathode is coupled through aswitching transistor 182 to a microprocessor output 183. Themicroprocessor outputs a 500 hertz signal at this output 183 having a20% duty cycle to the base input of the transistor. When the transistorturns on, the LED cathode is pulled low, causing the light emittingdiode 100 a to emit IR radiation. Under microprocessor control, thelight emitting diode produces a 500 hertz output which is sensed by aphoto detector 102 a. As the light emitting diode pulses on and off at500 hertz, the photo detector responds to this input. When current flowsin the photo detector, a voltage drop is produced across a voltagedivider 184 having an output coupled to an operational amplifier 186.When current flows in the photo detector in response to receipt of alight signal the voltage divider raises the voltage at the invertinginput 188 to the amplifier 186. The non-inverting input to thisamplifier is maintained at 2.5 volts by a regulated voltage divider 188.The operational amplifier 186 and a second operational amplifier 190define two inverting amplifiers which in combination produce an outputsignal of 500 hertz. With no signal appearing at the photo detector, anoutput 192 from the operational amplifier 190 is 2.5 volts. This signalis coupled to the microprocessor controller 2. In response to receipt ofthe photo detector signal, this signal oscillates and this oscillatingsignal in turn is sensed by the microprocessor.

The microprocessor controller 2 has two inputs 192, 194 that provideinput signals to a comparator implemented by the microprocessorcontroller. As the state of the comparator changes, internalmicroprocessor interrupts are generated which cause the microprocessorto execute certain functions. The first input 192 is derived from theoutput from the phototransistor 102 a. The second input 194 to thecomparator is a 3.3 volt signal generated by a voltage divider 195.

Motor Current Monitoring

A motor current monitoring circuit is depicted in FIG. 2D and includes anumber of operational amplifiers 200-203 coupled to a current measuringresistor 210 in the lower right hand portion of the circuit diagram.This current measuring resistor is coupled to the operational amplifier200 configured as a differential amplifier through a second resistor211. An output 212 from this differential amplifier is a signalproportional to the current through the motor windings which has beenamplified by a factor of about four. The output from this amplifierpasses to a second gain of 3 amplifier 201 to an output 214 coupled tothe microprocessor controller through a resistor 215. This signal ismonitored by the microprocessor and converted by an A to D conversion toa digital value directly related to motor current.

An input 220 to the second pair of operational amplifiers 202, 203 iseither an output from the first differential amplifier 200 or the secondgain of 3 amplifier 201 depending upon whether a resistor 222 isinstalled in the circuit. One but not both of the resistors 222, 223 areinstalled in the circuit.

The changing signal output from the resistor 210 is coupled to aninverting input of an AC coupled amplifier and produces an output signal226 to the microprocessor controller 2 which changes with motor currentand more particularly as the commutator brushes pass over the motorarmature commutation segments, the signal changes to form a sequence ofpulses. The amplifier 203 is a level shifting amplifier which reducesthe gain of the first amplifier depending upon sensed conditions. Whenthe motor first is activated a large current rush occurs due to the factthat the motor is stalled. This large current rush changes the output ofthe amplifier 203 thereby producing meaningful data even in a highcurrent situation. As the current changes, the output of this topamplifier 203 varies to allow meaningful data to be supplied to themicroprocessor regardless of absolute values of motor current.

The signal at the microprocessor is a analog signal having the ripplecomponent as the motor rotates. This signal is in turn interpreted bythe microprocessor controller 2 which generates values directly relatedto motor speed based upon the sensing and counting of these pulses.Additionally, the value changes in such a way that the slope can bemonitored so that the microprocessor can use digital signal processingtechniques on the input signal to determine a stalled motor conditionrepresenting an obstacle.

At motor startup the large currents that are experienced make itdifficult to sense object collisions with the moving window or panel. Inaccordance with one embodiment of the invention the controller maintainsa position of the leading edge of the window or panel and during certainstartups will alter a startup sequence.

If the window or panel is stopped in a region where entrapment is morelikely, such as in the last portion of travel just before closing of thewindow or panel, the motor is energized to move the window a shortdistance away from its stopped position away from the closed position. Acontroller which controls the motor then reverses motor rotation senseto move the window or panel in a direction to close the window or panel.Stated another way, the controller causes the motor to move the panel orwindow in a direction to open the window or panel and then change motorenergization to close the window or panel. This process avoids difficultto sense obstacle detection during the initial start up period of motoroperation.

The region of the window or panel seal is a region of increased motorload. In this region, in accordance with one embodiment of theinvention, in response to a detection of an obstacle, the controllerimmediately causes motor deenergization, followed by quick reversal ofactuation drive for a short distance (for example one inch). Thecontroller then performs an immediate re-energization in the initialdirection so that a more sensitive and accurate obstacle detectionprocess can be performed. The controller can either determine that theinitial obstacle detection was false due to actuator startup conditions,and thus continue to power the motor or else verify the obstaclepresence that was previously detected and cause the appropriate responseof stopping or alternatively stopping and reversing the window or panelfor a short distance.

Measured Motor Parameters—DC Current Sensing

By monitoring the two inputs 216, 226, the microprocessor controller 2monitors the motor current from which the controller 2 determines bothsunroof incremental position and speed. Sensed motor current is alwayspositive regardless of motor drive polarity and rotation direction. Foreither condition of drive polarity the non-energized side of the motoris connected to COMMON through the low value current sensing resistor210 to produce a positive analog signal voltage directly proportionateto the motor current.

This motor current signal is converted via hardware and/or software to afiltered signal and scaled by a fixed or optionally variable referencevoltage to produce a value less than a determined maximum value wherethe following definition applies: CUR={sensed motor currentanalog-to-digital-converted and scaled to engineering units}, where theanalog value for motor current is converted to eight-bit digitalresolution via an eight-bit ADC (analog-to-digital converter) within themicroprocessor controller 2. Eight bit resolution in a controllercounter for CUR yields an absolute count range of 0≦CUR≦255, where amaximum analog reference voltage is provided to the ADC to set theanticipated maximum possible motor current limit value represented by areference value 255.

A preferred means to increase sensed motor current resolution and thusimprove obstacle detection sensitivity is to adaptively adjust thereference voltage (set=value of 255 representative of full scale) and/orthe sensed motor current signal during times of relatively low currentoperation, returning to the highest scale during starting energization,end-stall detection, and as necessary for obstruction detection. Forthis eight-bit example, at least one bit of current measurementresolution can be gained during low current operation by decreasing thereference voltage by such means as a variable attenuation network and/orby scaling up the motor current signal by such means as a variable gainamplifier.

Analog motor current signal is lowpass filtered to remove noises frommotor current commutation and switching transients to produce a fastrunning average analog drive current signal to the microcontrollerrepresentative of motor torque load conditions. This voltage signal isconverted to a scaled digital value by the microprocessor. For example,normal steady operation of the motor at low battery voltage causes thecontroller to register a digital value of approximately 80 of full scale255, whereas startup energization at high battery voltage will result ina peak digital value of approximately 240 of full scale 255.

Measured Motor Parameters—AC Current Sensing

Typical DC brush motor current signals also have inherent waveform ACripples due to rotor current commutation. These motor current pulsesdirectly relate to incremental rotation of the motor shaft and sincegears and/or mechanical drive linkages link the shaft to the movingwindow or panel, directly relate to incremental change of position ofthe actuator. The relationship of motor current commutation pulses toactuator incremental motion is not necessarily a linear correspondence.

Motor current analog signal can be AC coupled, bandpass filtered,amplified, and compared with a threshold to produce a digital signal viaan input representative of motor current commutation signals.Alternatively, motor current commutation signals can be directly sensedfrom the motor current signal via ADC and digital signal processingbandpass filtering having sufficient resolution to accurately measurethe relatively lower amplitude waveforms characteristic of motor currentcommutation pulses.

Various alternative and more expensive incremental encoder, absoluteencoder, and resolver means can produce similar signals representativeof incremental or absolute motor rotor position.

A parameter monitored by the controller, indicated by a variable, PP,has generic units of time per fixed increment of motor rotation or timeper distance which is defined as: PP={integer number of microcontrollerclock cycles per incremental motor encoder pulse period}, alternativelyreferred to as inverse speed or per speed. Eight-bit resolution in aninteger counter for PP yields an absolute range of 0≦PP≦255.

An input from a resistor network provides a reference voltage (in thedisclosed design about 2.5 volts) to an operational amplifier configuredas a comparator. Each time the motor current commutates a generatedspike is transmitted through a coupling capacitor to this comparator to“square up” the output waveform for input to the microprocessorcontroller. The microprocessor counts the number of microcontrollerclock pulses between adjacent motor current commutation pulse signals asan indication of pulse period (PP), which is inversely proportionate tomotor speed.

As an example, a relatively low count of 72 clock cycles per incrementalmotor encoder pulse period is representative of typical steady operationat maximum motor power supply voltage under light loading conditionswhereas the count of 240 clock cycles per encoder pulse period isrepresentative of typical transient startup energization acceleration atminimum motor power supply voltage under heavy loading conditions.

As an alternative to a presently preferred current sensing process,other means of determining motor speed are contemplated. Alternate speedsensing technologies include monitoring changes in a magnetic field andconverting such changes to a speed of movement. Non-contact sensors forsuch monitoring include: Hall effect, magnetoresistive, magnetodiode,magnetotransistor, Wiegand effect, and variable reluctance; capacitive;and optical sensors. Such encoders are contemplated in U.S. Pat. No.5,334,876, FIG. 5 which depicts pulses produced by a motor shaft encoderthat monitors position, speed and direction of travel of a window orpanel.

In accordance with an alternative embodiment of the invention,reflective and blocking sensing; generated inductive magnetic fields:ECKO (eddy current killed oscillator), variable inductor, and variabletransformer; and film resistor can be used to monitor window or panelmovement.

Position Accuracy

Motor current commutation pulses occur at generally regular intervalsover the travel path of the panel. One representative vehicle sunroofhas approximately 3000 commutation pulses over the full actuation rangeof the full open to the full CLOSED positions of the sunroof.

Back extrapolation of decreasing pulse periods upon startup indicatesthe typical loss of approximately one sensed pulse upon motorenergization due to the excessive time duration of the first pulse. Thislost pulse is either added or subtracted, depending upon direction ofenergization, to or from the actuator position counter register toincrease incremental position detection accuracy.

Weak and/or missing motor pole signals, due to a faulty coil and/orcommutator segment, are detected via software algorithms that callautomatic compensation algorithms to maintain a corrected positioncounter register value. Therefore, missed motor current commutationpulses ostensibly representative of motor deceleration magnitude beyondempirically-determined limits are pulse simulated for accuraterepresentation of motor speed and actuator position.

Extraneous pulses representative of motor acceleration beyondempirically-determined maximums are deleted from processing to maintainaccurate representation of motor speed and actuator position. Adaptingparameters for a DSP bandpass filter algorithm, based upon motor currentand speed, enable improved motor current commutation pulse-sensingsignal-to-noise ratios that result in improved accuracy for incrementalposition and speed sensing and ultimately in improved obstacle detectionaccuracy and sensitivity.

Minor corrections are made to a position counter register based uponempirical determinations of numbers of motor current commutation pulsesmissed due to inertial motion after motor de-energization. This numberof missed pulses is based upon the speed of the motor due primarily tothe monitored power supply voltage. To reduce errors in this inertialcorrection term, consistent motor speeds and thus consistent number ofmissed pulses are achieved at motor de-energization by energization ofthe motor for no less than a minimum time duration in response to even avery brief actuation of the manual motor energization switch.Furthermore, software debouncing of the manual switch contact deglitchesthe switch outputs at the microcontroller inputs by requiring the switchcontacts be sensed for some minimum time to be considered as a validcontrol input. Excepting abnormal circumstances such a power loss and/orobstruction detection, activation of the manual motor energizationswitch for more than the debounce time will result in motor energizationfor at least a minimum amount of time, thus providing sufficient time toachieve a relatively consistent speed and also a relatively consistentnumber of missed pulses after de-energization.

Position Sensing & Alternatives

By counting motor current commutation pulses as an incremental encoder,the microcontroller maintains a representation of actuator position byupcounting or downcounting a position count register based upon whetherthe motor is being energized in a clockwise or counterclockwisedirection. Limit switch inputs and/or end-of-travel stall currentindications indicate where the microcontroller position counter registeris either SET or RESET.

This method of position sensing is significantly simpler and less costlythan alternate well-known methods of sensing position using specializedsensors such as incremental encoders, absolute encoders, and resolvers.Improvements provided by adaptive DSP bandpass filters increase thesignal-to-noise and performance accuracy of this sensorless electronicposition encoding method and means to render it now technically viablefor this implementation.

Alternate position-sensing technologies include permanent magnet fields:Hall effect, magnetoresistive, magnetodiode, magnetotransistor, Wiegandeffect, and variable reluctance; capacitive; optical: Reflective andblocking; generated inductive magnetic fields: ECKO (eddy current killedoscillator), variable inductor, and variable transformer; and filmresistor.

No Template Calibration—Simple Position & Range Learning

Upon powerup, the calibration and/or learning of characteristic currentand/or speed versus position may not be necessary. In accordance withcertain embodiments of the invention, the only required learning is theabsolute position of the actuator from a position input so that anincremental position counter can be either SET or RESET. This trueposition can be provided by such means as a limit switch, a Hall-effectswitch at a known actuator position, and/or by sensing motor stallconditions at the ends of travel. Resetting the absolute positioncounter is necessary with some embodiments that sense motor commutationpulses for incremental position encoding. Alternatively, the use of amore expensive absolute encoders having no such incremental positioncounter and requiring no such resetting is a performance versus costengineering design tradeoff decision. By measuring the position of theroof through the sensor on the motor, the full open and close positionscan be determined without the need of additional limit switches orsensors to determine end-of-travel. Also, the true position can bedetermined by the end-of-travel by the current of the motor, or thepreferred method is to detect no position movements through the motorposition sensor and detect end-of-travel and therefore stall. Thecompensation for the window sizes and travels can be pre-programmed viamemory locations at the factory or it can be programmed in a training ofinstallation mode thus eliminating the need for additional end-of-travelswitches for home positions.

For certain cases the sunroof controller can be used with more than onetype of sunroof, therefore calibration is really a misnomer for whatamounts to determining which type of sunroof mechanism is beingcontrolled by learning the characteristic range of allowable motion ofthe cooperating mechanism, as well as the actuator position. Thecalibration step need only be performed the first time power is appliedto the circuit, or if the physical characteristics of the sunroofchange. Until calibration is performed, a automatic operation expressmode movement feature is inhibited.

Recalibration can be initiated at any time the user feels that thecontrol circuit is not performing as it should and must always be doneif either the controller 2 or the sunroof is changed. The size of theroof is recorded in the EEPROM as well as an identification word flag toenable sunroof operation in the express mode. The position of thesunroof is recorded in the EEPROM each time the sunroof is stopped frommoving. This is done to guarantee that in the case of a power downsituation, the current position of the sunroof is always known. If atany time the position is considered to be unknown, the express mode isdisabled until the next time the sunroof is moved to the fully CLOSED orhome position.

The calibration learning of the movement range and position of thesunroof are learned and recorded as follows. The ignition is turned OFFand within five seconds the OPEN switch is pressed and the ignition isswitched ON. The controller 2 attempts to find the HOME or PARK positionthen proceeds to find the limit of the open area or the sunroof, i.e.the fully open position. When a stall condition is sensed the size ofthe sunroof open area (by count of motor encoder pulses) is recorded andthe controller reverses the direction toward the PARK position. Thecontroller then finds the limit of the vent area by driving the sunrooftoward the full VENT position until a stall condition is sensed. A stallcondition is determined when analog-to-digital converted motor currentis equal to or greater to 180 on the unitless current scale ranging from0 to 255. If it is not possible to perform the calibration due to afailure to find the park position, no information is recorded and thesunroof express mode (automatic operation) is disabled.

Soft Stop

High position sensing resolution and accuracy enable the actuationsystem to anticipate the mechanical limit and thus deenergize the motordrive just prior to the actuator hitting its hard stop limit. This saveswear and tear on the mechanism as well as aids in maintaining high motorcommutation pulse sensing accuracy. Mechanical “windup” of actuatordrive components is significantly reduced by deenergizing and thusstopping the actuator before the torque becomes unnecessarily excessive.Reduction of mechanical windup further improves the consistency of themotor current commutation pulse train of a subsequent motorenergization, thus enabling both improved capability of obstacledetection at startup and quicker obstacle detection thresholdadaptation. Utilization of motor current commutation pulse sensing as anincremental encoder is enhanced in both speed and position accuracy byreduction of pulse sensing errors associated with windup relaxation anderratic motor pulse train upon startup.

Soft stop also limits high values of end-of-travel motor current, thusenabling improved current sensing resolution by use of a lower ADC motorcurrent reference value that is significantly closer to normal operatingvalue than to higher stall value. High position sensing accuracy enablesimproved position-related determination of critical and fast-changingobstacle detection thresholds. High position sensing accuracy alsoenables accurate anticipation of increased motor loading due to theelastomeric environmental seal near the closing of the panel, thusobstacle detection thresholds are appropriately increased as a functionof position.

Digital Signal Processing

Motor current is sensed by preferred DSP techniques that provide lowpasssoftware filtering of the motor current signal to filter out electricalnoises, especially the undesirable frequency ranges characteristic ofcommutation pulses, switching transients, pulse drive transients, anddrive transients.

Motor current commutation pulses are sensed by preferred DSP techniquesthat provide bandpass software filtering of the motor current signal tohighpass filter out the DC motor current signal and to lowpass filterout electrical noises and especially the undesirable frequency rangescharacteristic of pulse width drive transients, when applicable.

Additionally, adaptive DSP algorithms modify the obstacle detectionthresholds in real time response to actual monitored motor operationparameters. A static shift in motor current and/or speed will result ina related shift in obstacle detection threshold. A transient dynamicmotor current and/or speed will result in a related shift in obstacledetection threshold. Sensed periodic cyclical dynamic motor currentand/or speed will result in a related periodic cyclical obstacledetection threshold.

Advantages of DSP versus hardware implementation as described aboveinclude smaller circuit size, fewer components, lower cost, lower mass,and especially ability to adapt filter algorithms for pulse detectionthresholds during operation to improve performance characteristics.

Variable Load Parameters—Adaptive Obstacle Detection Threshold

With the sunroof panel automatic powered actuator system, normal vehicleinside-to-outside relative pressure differences and/or wind buffetingcan cause respective static, periodic dynamic, and/or transient dynamicvariations in the effective actuator motor loading and thus in the motorcurrent that is compensated for by algorithms for adaptive obstacledetection thresholds. Increasing vehicle wind speed and/or operation offorced vehicle ventilation can produce static pressure differences thatincrease the load on the sunroof panel motor during operation.Increasing vehicle wind speed and/or external conditions can producecyclical wind buffeting conditions that correspondingly cyclicallyalters the motor loading. Amplitude and frequency of cyclical buffetingas fluid vortices is a function of relative fluid velocity. In certaincircumstances, there is a relationship between cyclical wind buffetingand static differential air pressure. Obstacle detection thresholds areactively modified with increasing vehicle air speed and with increasingwind buffeting to reduce false obstacle detection. It is anticipatedthat information about the vehicle speed and/or direction can providevalue to the sunroof application by correlation with characteristicloading of the vehicle sunroof and/or window operation.

Unique software algorithms enable characteristic determination of realtime actuator operation load categorized as startup transient, nominal,static variable, periodic dynamic variable, transient dynamic, softobstacle, and hard obstacle. Nominal load is the characteristic motorcurrent and speed as empirically pre-characterized for the actuator.Static variable represents a steady factor of the nominal load by whichthe ongoing nominal actuation is correspondingly factored up or down.Transient dynamic load represents temporary load magnitude excursionterms by which the ongoing nominal actuation parameter is altered.Periodic dynamic is a cyclical load term by which the ongoing nominalactuation is cyclically loaded with a regular period and amplitude.

FIGS. 5-7 show simplified examples of how DSP is applied in real time toalter and reduce obstacle detection function thresholds for increasedobstacle detection sensitivity tolerances. The inventive obstacledetection function threshold adaptively responds via superposition ofindividual responses to various simultaneous types of load disturbancevariables herein described.

FIG. 5 shows an example of a simplified case of a typical obstacledetection threshold based on template technology versus the adaptiveobstacle detection function threshold of the present invention. Therelatively large and fixed obstacle detection threshold accommodates thethree types of system load variables described above. Adaptive obstacledetection achieves comparatively lower threshold values with highersensitivity than fixed threshold systems by virtue of its ability toadapt to various types of system load variables.

FIG. 6 shows an example of a simplified case of a DSP adapting theobstacle detection function threshold in real time to accommodatedynamic load shifts. Note that the adaptive threshold tracks the motoroperation function with intentional adaptive response delay time andslew rate. The degenerate case of a static load shift is not shown,although somewhat similar to FIG. 6. A comparatively lower thresholdvalue and higher sensitivity is achieved by virtue of the ability toadapt to various types of system load variables.

FIG. 7 shows an example of a simplified case of inventive DSP adaptingthe obstacle detection function threshold in real time to accommodateperiodic cyclic dynamic load variations. Initially, before periodicityis ascertained, the adaptive response delay time of FIG. 6 prevails.Upon a determination that the disturbance is strictly periodic, as witha bad gear tooth, after perhaps three cycles, the adaptive responsedelay time delay time is reduced to more accurately track the knownperiodicity of the cyclic disturbance. A comparatively lower thresholdvalue and thus higher sensitivity is provided by the ability to adapt tovarious types of system load variables. Note that after cyclicalperiodicity of the disturbance is established, the normally laggingresponse of the adaptive threshold obstacle detection function becomespredictive so the periodicity of the dynamic response of the adaptivethreshold obstacle detection function becomes in phase with the relateddynamic disturbance of the motor operation function. Thus, the adaptivethreshold more closely tracks actual motor operation function. The netresult is obstacle detection with greater sensitivity to real obstacleswith reduced occurrences of false obstacle detection.

The engineered characteristic response time, slew rate, and frequencyresponse of the real time adaptive obstacle detection thresholdalgorithm must respond in a manner significantly less than 180 degreesout of phase with anticipated cyclical load variables, yet not so fastas to interfere with either hard and/or soft obstacle detectionalgorithms. These adaptive threshold response constraints effectivelylimit how fast the real time adaptive obstacle detection functionthreshold is allowed to change in response to changes in load variablethat are ascertained to be not caused by hard or soft obstacleinterference. It is important to see that the real time adaptiveobstacle detection function threshold is equal or lower than the fixedobstacle detection threshold. Lower obstacle detection functionthresholds produce more sensitive obstacle detection, faster obstacledetection, faster actuator deenergization, faster actuator stopping, andlower peak obstacle force at final stopping position.

Reduced Actuation Speed

Circuitry disclosed in U.S. Pat. No. 5,334,876 uses a PWM (pulse widthmodulated) activation of the motor windings of a direct current motor tocontrol and/or regulate the speed of motor output shaft rotation as themotor opens or closes the window or panel. The present system preferablyapplies full battery voltage of a motor vehicle across the motor todrive actuator panel motion. As the motor controller industry learns tomeet obstacle detection anti-pinch force regulations, it is fullyanticipated that allowable forces might be lowered, possibly resultingin the necessity to use motor drive speed-reducing techniques to enablefull regulatory compliance.

Typical applications of drive power to a motor include full power supplyvoltage, fixed duty cycle pulse drive, PWM (pulse width modulation) toregulate average motor speed and/or acceleration, pulse repetitionmodulation to regulate average motor speed and/or acceleration, lineardrive of a fixed fraction of the full power supply voltage, linear driveof a fixed voltage, controlled linear drive to regulate average motorspeed and/or acceleration, and phase angle switching control for ACmotor applications. Switching transients are reduced and RFI/EMC isimproved for any of the above switchmode methods of motor drive byfiltering the drive output and/or controlling the slew rate of turn onand/or turn off of the motor drive power.

Relays and power contactors are typically utilized for relatively slowpower control applications such as for switching on/off and forswitching energization between forward and reverse. Solid state switchesare typically utilized for relatively fast power control switchingapplications. Solid state linear drive components typically requiresignificant heat sinks to dissipate the waste heat, although therelatively smooth output drive voltages are best for motor drive and lowRFI EMC issues. Furthermore, AC motor applications typically use triacsor SCRs (silicon controlled rectifiers) for phase switching control ofmotor power.

Generic Obstacle Detection

To detect an obstruction when the sunroof panel is closing in itsautomatic operation mode, in brief, the microprocessor measures themotor current and speed for the ongoing actuation and compares againstan empirically-determined algorithm within the controller for motorcurrent and speed versus position and/or time. When calculations basedupon sensed current, pulse period, derivatives thereof, and actuatorposition cause a calculated threshold to be exceeded, an obstruction isascertained and the sunroof is brought back to its full OPEN or fullVENT position.

A trippoint calculation utilizes memory buffers to store motor operationparameter information needed to make a determination about obstructiondetection. If the sunroof is calibrated and is subsequently placed inthe automatic close mode, the controller 2 uses the contents of thesebuffers to determine the presence of an obstruction. Variations ofnumerical term and factor values of the obstacle detection thresholdalgorithm of cited references, commonly owned, are fully anticipated perempirical characterization of any particular actuation system. Such termand factor values can be predetermined and/or adaptive via DSPalgorithms. It is impractical to even attempt to show all apparentvariations.

Trip point algorithms are based upon empirically obtained measurementsfrom actuations over chosen ranges of operating conditions.

The pulse period relates to sunroof speed. As the speed increases,factors that utilize pulse period (PP) cause obstruction indication moreeasily than at low speed. Stated another way, the threshold is made tobe close to the operating current since there is a shorter time to reactto the occurrence of an obstruction.

Other terms relate to motor current. Another term avoids obstructionsensing for a sharp current increase due to spurious and short livedcurrents that might otherwise cause false obstruction detection. Nominalvalues for I (motor current) are from 40 to 80. These do not correspondto units of amperes or milliamperes, but are instead scaled engineeringunits based upon the motor and circuitry used to sense the motorcurrent.

Startup Obstruction Detection Summary

FIG. 4 shows typical startup energization characteristics of current andper speed for a motor. Startup obstacle detection is somewhat difficultbecause the characteristic startup current for a motor typically beginswith a quick inductive rise toward a peak value primarily limited by theresistive impedance of the motor coil and speed starts from zero.Startup current peaks typically approach stalled rotor current ofapproximately four and one half to six times normal operating current.Starting currents peak quickly, approaching a typical maximum value ofapproximately 75% of stalled rotor condition, after which motor currentgradually reduces to a steady state operating condition primarily due toincreasing back EMF (electromotive force) generated by gradualincreasing rotation speed of the rotor. Higher reference values forcurrent sense scaling can be preferred for startup and stall conditionsversus normal steady operation.

Relatively fast clock speeds of microcontroller circuitry enable fastdetection of hard obstacles at startup by monitoring parameters of motorcurrent and motor PP. Algorithms based upon monitored parameter valuesof motor voltage and motor current load, during a fixed startup timeinterval enable predicted anticipation of motor speed. If the sensedspeed at the end of the fixed startup time interval is below adetermined threshold, then an obstacle is determined. If the sensedcurrent at the end of the fixed startup time interval is above adetermined threshold, then an obstacle is determined.

Expressed in other terminology, after allowing some small initial amountof time for the motor rotor to begin rotation, I is immediately measuredand compared against a fixed maximum threshold value and PP isimmediately measured and compared against some maximum threshold numberof clock cycles. If either measured parameter variable exceeds its fixedthreshold value, then a hard obstacle detection is made and motor driveis immediately discontinued, and the actuation is briefly reversed torelease the obstruction. The initial amount of time is that time duringwhich a significant increase in motor speed is expected to bemeasurable. A larger motor and a motor with greater associatedrotational inertia from the load will both typically require a longeracceleration time.

Hard Obstacle Detection Summary

In brief, hard obstacle detection is generally based upon adaptivealgorithms that evaluate an immediate short history of motor current andspeed of the immediate actuation. Hard obstacle detection is via fastprocessing algorithms of at least one FIFO memory containing sequentialmeasurements of motor electrical current and per speed. Runningcalculations based upon the FIFO memory of measured values are stored inat least one FIFO memory. Hard obstacle detection after startup isperformed via two algorithms. One algorithm method is based upon speedand rates of change of speed (also known as acceleration anddeceleration) and/or rates of change of acceleration or deceleration(also known as jerk) to determine at least one value in excess of atleast one limit. Another algorithm method is based upon measurements ofmotor current and derivatives thereof based upon time and/or position attimes and/or positions determined at each motor commutation pulse andwith further calculations based thereupon to determine at least onevalue in excess of at least one limit.

Hard obstacle threshold detection limits based upon motor current arealso modified based upon the number of microcontroller pulses countedper motor current commutation pulse period. The condition of exceedingeither one of these adaptive threshold limits is construed as hardobstacle detection. Implementation of this method is by utilization ofat least one FIFO memory for storing such running measured values as PPand/or I, as previously defined. Additional FIFO memory can be used tostore additional running calculated values based on PP and/or I. Theserunning calculated values based upon time and/or position are of typesincluding first derivative, second derivative, higher orderderivative(s), weighted running averages, algebraic expressions,logarithms, statistical functions, and the like for computation ofadaptive thresholds based thereupon.

Fast real time digital processing routines are simplified algebraicequations derived from piecewise linearization and/or other simplifiedalgorithms for curve fitting of empirical sunroof panel operationaldata. Depending on accuracy requirements and relative algorithmprocessing speeds, higher order curve-fitting routines are anticipated.Hard obstacle detection occurs when either I and/or PP exceed a runningadaptive threshold value comprised of terms based upon fixed, static,and/or dynamic values.

Soft Obstacle Detection Summary

In brief, soft obstacle detection is generally based upon adaptivealgorithms that evaluate an immediate history of motor current and speedof the immediate actuation. The immediate history is much longer thanthat immediate short history per hard obstacle detection algorithms.Soft obstacle detection is also via fast processing algorithms of atleast one FIFO memory containing sequential measurements of motorelectrical current and per speed. Running calculations based upon theFIFO memory of measured values are stored in at least one FIFO memory.Soft obstacle detection after startup is performed via two algorithms.One algorithm method is based upon speed and rates of change of speed(deceleration) to determine at least one value in excess of at least onelimit. Another algorithm method is based upon measurements of motorcurrent and derivatives thereof based upon time and/or position at timesand/or positions determined at each motor commutation pulse and withfurther calculations based thereupon to determine at least one value inexcess of at least one limit.

Implementation of this unique method is by utilization of at least oneFIFO memory for storing such running measured values as PP and/or I.Additional FIFO memory can be used to store additional runningcalculated values based on PP and/or I. These running calculated valuesbased upon time and/or position are of types including first derivative,second derivative, higher order derivative(s), weighted runningaverages, algebraic expressions, logarithms, statistical functions, andthe like for computation of adaptive thresholds based thereupon. Fastreal time digital processing routines are simplified algebraic equationsderived from piecewise linearization and/or other simplified algorithmsfor curve fitting of empirical sunroof panel operational data. Dependingon accuracy requirements and relative algorithm processing speeds,higher order curve-fitting routines are anticipated. Soft obstacledetection occurs when either I and/or PP exceed a running adaptivethreshold value comprised of terms based upon fixed, static, and/ordynamic values.

Software Digital Signal Processing Techniques

Algorithm methods generally used for data analysis can include timedomain and/or frequency domain techniques. These data processingtechniques include, but are not restricted to, algebraic manipulation,logical comparison, convolution, convolution integral, Fouriertransforms, fast Fourier transforms, discrete Fourier transforms,z-transforms, wavelet analysis, and the like. Digital signal processingtechniques and algorithms are used to monitor data from motor operationparameters and/or derived data thereof in practical real time toascertain motor operation parameter changes characteristic of undesiredobstacle loading.

Collision Detection Notation

Measured readings of hardware-filtered I_(n) (motor current) and PP_(n)(pulse period) are triggered by and thus synchronized with motor currentcommutation pulse detections. Multiple FIFOs (first-in-first-outmemories) are utilized to store running measurements of I_(n) and PP_(n)as well as calculated values derived therefrom. In a very general sense,both hard obstruction detection and soft obstruction detectionalgorithms are based upon weighted factors of the history of runningmeasurements and running calculations. Hard obstacle detection is biasedmore toward a relatively recent-term history, whereas soft obstacledetection is weighted more toward a relatively longer-term history.

Generalized obstacle detection is considered as an abbreviated subsetfrom a very broad set of weighted factors based upon a running historyof measured motor operation parameters and data calculations basedthereupon for the immediate actuation operation. Prior methods ofobstacle detection implement the method of predetermining an operationparameter template based upon some number of running weighted averagesof sequential prior actuations. The present method uses no suchpredetermined operation parameter template, but rather calculates bothhard and soft obstacle detection thresholds during the immediateactuator operation based upon at least one software algorithm.

Motor speed fractionally varies significantly more than does motorcurrent with magnitude of motor supply voltage. Motor torque loadcorrelates very well with motor current. Thus, motor current is theprimary measured parameter of immediate importance for both hard andsoft obstacle detection. Obstacle detection is desensitized toelectronic noise by implementing a running software filter to calculatenoise-reduced motor current for determination of obstacle detection.Obstacle detection is based upon measurements of motor current and motorspeed per the following notations.

Processing equations, data, and variables utilize the followingnotations and definitions.

Subscript n represents pulse number, n≧0, where

n=0≡most recent motor current commutation pulse

n=1≡motor current commutation pulse just prior to n=0

n=2≡motor current commutation pulse just prior to n=1.

Subscript m represents the identifier for motor operation term weightingfactors, m≧0, where

Km≡empirically determined term-weighting factors, alternativelyadaptive.

Measured motor operation parameters, FIFO registers, where

I_(n)≡measured motor current at the nth commutation pulse

PPn≡counted number of clock cycles per pulse period between motorcurrent commutation pulses from pulse n to (n+1).

Calculated motor operation values, FIFO registers, where

-   I_(R0)≡calculated running software-filtered value of prior    sequential measured motor currents in range zero-   I_(R1)≡calculated running software-filtered value of prior    sequential measured motor currents in range one-   I_(Ra-f)≡calculated running software-filtered value of prior    sequential measured motor currents in ranges a-f (a through f) . . .    .-   {Min I_(Ra-f)}≡determined value of a minimum of motor current    readings in prior sequential ranges a-f-   {Max I_(Ra-f)}≡determined value of a maximum of motor current    readings in prior sequential ranges a-f-   PP_(R0)≡calculated running software-filtered value of prior    sequential counted PP in range zero-   PP_(R1)≡calculated running software-filtered value of prior    sequential counted PP in range one-   PP_(Ra-f)≡calculated running software-filtered value of prior    sequential counted PP in ranges a-f

Very recent motor operation parameter history is represented by at leastone data set range given numeric identifier. Range zero includes datasets represented by the most recent sequential few motor currentcommutation pulses, typically 4 to 8 pulses. Range one includes datasets represented by a similar number of 4 to 8 motor current commutationpulses immediately prior to range zero. Although ranges zero and onetypically represent data sets for 4 to 8 motor current commutationpulses each, the quantity of represented data sets can be as low as 1and higher than 16, as determined by system operation requirements andmonitored dynamic system conditions. Furthermore, the quantity ofrepresented pulses per data set can be interactively modified inresponse to variations of measured motor operation parameters. Thenumber of data sets in ranges one and two are empirically determinedsomewhat by the extent of software filtering necessary to adequatelyrepresent very recent history of motor operation parameters.

The quantity of such numeric identifier data ranges can be as low as 1and higher than 8, depending upon actuator system dynamic response andfast filtration algorithm requirements. Furthermore, the quantity ofdata sets can be interactively modified in response to variations ofmeasured motor operation parameters. Fast filtration requirements aredetermined by the electrical noise level, the number of motor currentcommutation pulses per motor revolution, the numbers of gear teeth indrive mechanisms, mechanical vibrations, and the like.

Longer recent motor operation parameter history is represented by atleast one range given alphabetic identity. Range a, b, c, d, e, and fincludes six data sets each represented by a significantly larger dataset range than numeric identifier ranges zero and one. Although sixranges are here described, this quantity can be as low as one and higherthan six, as determined by system operation requirements and monitoreddynamic system conditions. Typically, each of the ranges a-f includes 8to 24 data sets. Range a represents the most recent sequential motorcurrent commutation pulses. Range b represents the similar-sized rangeimmediately preceding range a. Likewise, up to range f. The number ofdata sets in ranges a-f can be as low as one and significantly higherthan 24, depending upon slow filtration algorithm requirements.Furthermore, the number of data sets in each of ranges a-f, as well asthe quantity of ranges, can be interactively modified in response tovariations of measured motor operation parameters. Fast filtrationrequirements are determined by the electrical noise level, the number ofmotor current commutation pulses per motor revolution, the numbers ofgear teeth in drive mechanisms, mechanical vibrations, frequency ofperiodic load disturbances, and the like.

Following examples will describe the use of two numeric identifier dataset ranges zero and one, for very recent motor operation data, with eachrange representing data sets for six motor current commutation pulses.Following examples will also describe the use of six alphabeticidentifier data set ranges a-f, for longer recent motor operation data,with each range representing data sets for 15 motor current commutationpulses.

In a simple preferred case, calculated running software-filteredalgorithms determine even-weighted boxcar averages of sequential datafrom defined FIFO ranges, as follows.

For defined range zero,n=x−1I _(R0)≡3A _(n) I _(n)n=0andn=x−1PP _(R0)≡3A _(n) PP _(n).n=0In this simple preferred example case, setx=6 and A _(n)=(1/x)to produce evenly weighted boxcar averages from data representing sixsequential motor current commutation pulse measurements. And likewise,n=2x−1I _(R1)≡3A _(n) I _(n)n=xandn=2x−1PP _(R1)≡3A _(n) PP _(n)n=xfor range one.

In similar manner, evenly weighted boxcar averages are calculated fromdata in defined alphabetic ranges, as follows.

By settingy=15 and A _(n)=(1/y)and applying into equationsn=y−1I _(Ra)≡3A _(n) I _(n)n=0n=2y−1I _(Rb)≡3A _(n) I _(n)n=yn=3y−1I _(Rc)=3A _(n) I _(n)n=2yn=4y−1I _(Rd)≡3A _(n) I _(n)n=3yn=5y−1I _(Re)≡3A _(n) I _(n)n=4yn=6y−1I _(Rf)≡3A _(n) I _(n)n=5yand into equationsn=y−1PP _(Ra)≡3A _(n) PP _(n)n=0n=2y−1PP _(Rb)≡3A _(n) PP _(n)n=yn=3y−1PP _(Rc)≡3A _(n) PP _(n)n=2yn=4y−1PP _(Rd)≡3A _(n) PP _(n)n=3yn=5y−1PP _(Re)≡3A _(n) PP _(n)n=4yn=6y−1PP _(Rf)≡3A _(n) PP _(n)n=5y

These evenly weighted running software filtered averages are used toreveal calculated trends in larger recent motor operating parameterhistory.

For a system where algorithm processing must be very fast, the use ofrange sizes that are integer powers of the number 2, e.g. 1, 2, 4, 8,16, 32, etc., result in boxcar averaging weighting factors that are veryquickly multiplied by simply and quickly bit or nibble shifting themeasured data.

In addition to running filtered shorter-term and longer-term averages ofrespective numeric range data and alphabetic range data it is necessaryto compute dynamic noise levels of measured parameters to compensateobstacle detection thresholds for system noise. Increased relative noiselevels necessitate increased obstacle detection thresholds to avoidfalse obstacle detection with subsequent stopping and reversal of theactuator. Such noise levels are computed from minimums and maximumsdetermined by the following definitions.

{MinI_(Ra)}≡minimum value of motor current readings in range a

{MinI_(Rb)}≡minimum value of motor current readings in range b

{MinI_(Rc)}≡minimum value of motor current readings in range c

{MinI_(Rd)}≡minimum value of motor current readings in range d

{MinI_(Re)}≡minimum value of motor current readings in range e

{MinI_(Rf)}≡minimum value of motor current readings in range f

{MaxI_(Ra)}≡maximum value of motor current readings in range a

{MaxI_(Rb)}≡maximum value of motor current readings in range b

{MaxI_(Rc)}≡maximum value of motor current readings in range c

{MaxI_(Rd)}≡maximum value of motor current readings in range d

{MaxI_(Re)}≡maximum value of motor current readings in range e

{MaxI_(Rf)}≡maximum value of motor current readings in range f

Maximums and minimums from multiple alphabetic ranges are per theseexamples.

{MinI_(Rb-f)}≡minimum value of motor current readings in ranges b-f

{MaxI_(Rb-f)}≡maximum value of motor current readings in ranges b-f

Obstacle detection is based upon the history of minimum and maximummotor operation parameter measurements. The difference between theminimum and the maximum values gives an indication of the measured noiselevels.

A very generic equation for obstacle detection includes above factors,shown below. Note that the term including the factor I_(R0) isincorporated into the term on the left side and accommodated by suitableadjustment of remaining K_(n) factors.

Hard and/or Soft Obstruction DetectionIf I _(R0) ≧[K ₁ I _(Ra) ]+[K ₂ I _(Rb) ]+[K ₃ I _(Rc) ]+[K ₄ I _(Rd)]+[K ₅ I _(Re) ]+[K ₆ I _(Rf) ]+[K ₇ PP _(Ra) ]+[K ₈ PP _(Rb) ]+[K ₉ PP_(Rc) ]+[K ₁₀ PP _(Rd) ]+[K ₁₁ PP _(Re) ]+[K ₁₂ PP _(Rf) ]+[K ₁₃ I _(R1)]+[K ₁₄{MinI _(Ra-f) }]+[K ₁₅{MaxI _(Ra-f) }]+[K ₁₆ PP _(R0) ]+[K ₁₇ PP_(R1) ]+K ₈Then an Obstacle is Detected

All of the above factors based upon I, PP, and calculated values thereofare preferred to be simple evenly weighted running averages and/orsimple maximum and minimum comparisons that process relatively quickly.The large quantity of algebraic and logical operations precludescomplete processing fast enough to quickly detect an obstruction andstop before pinch forces exceed safe limits.

Algorithm processing for hard and soft obstruction detection is dividedinto two separate equations, weighting the various terms depending uponmagnitude of importance and processing time requirements. The followingexamples show generalized and preferred algorithms for hard and softobstruction detection. K_(n) factors are empirically determined to meetsystem dynamic performance mandates.

Hard Obstruction DetectionIF I _(R0) ≧[K ₁ I _(R1) ]+[K ₂ PP _(R1) ]+K ₃Then an Obstacle is Determined.

Hard obstruction detection is imperative to determine very quickly sothis implementation keeps processing requirements to a low level, yetenables fast and reasonably precise hard obstacle detection. Large rangeaverage terms including current, pulse period, minimum current, andmaximum current are all considered insignificant enough in the tradeoffagainst speed so they are removed. Small range average motor current,I_(R0), is thus unitlessly compared with the sum of three terms I_(R1),PP_(R1), and K₃. This essentially compares immediate average currentwith immediately prior average current and immediately prior averagepulse period plus an offset constant. Thus, a quick increase insustained motor current tends toward hard obstruction determination.High values of pulse period indicate that the motor is running slow withhigh torque, so the difference between the actuator force and themaximum allowable pinch force is also low. Thus, high values of pulseperiod also tend toward hard obstruction determination.

Soft Obstruction DetectionIF I _(R0) ≧[K ₄ PP _(Rb-f) ]+[K ₅{MinI _(Rb-f) }]+[K ₆{MaxI _(Rb-f)}]+K ₇Then an Obstacle is Determined.

Soft obstruction detection is not nearly as time sensitive, as is hardobstruction detection, thus additional terms can be computed in the timeallowed before the slow increase in entrapment force exceeds maximumallowable values. The large range average term for pulse period ofranges b-f provides a relatively stable representation of pulse periodthat relates inversely with speed. As speed is decreased, pulse periodis increased. High values of PP indicate that the motor is running slowwith high torque, so the difference between the actuator force and themaximum allowable pinch force is also low. Thus, high values of pulseperiod also tend toward hard obstruction determination. The large rangeminimum and maximum terms for motor current in ranges b-f are lumpedtogether into two terms to provide a practical combination of termsrepresenting both average current and current noise range. Dynamicloading conditions produce dynamic currents that result in a wider rangeof maximum, minimum, and maximum minus minimum current values. Highvalues of current noise necessitate higher soft obstruction detectionthreshold values to avoid nuisance detection.

Depending upon the periodicity of motor loading conditions, it ispossible to not only adapt thresholds reactively, but also topredictively adapt thresholds in anticipation of continued cyclicloading conditions. Software algorithms that evaluate various alphabeticrange sizes of the FIFO data set to quantify max and min enabledetermination of alternating amplitudes characteristic of frequencyand/or frequencies for which motor operation parameter loading revealscyclic periodicity. Adaptive predictive compensation of soft obstacledetection enables improved sensitivity for set detection thresholds withreduced affect by cyclic dynamic loads such as wind buffeting orrepetitive gear loading. The obstacle detection threshold is cyclicallymodified in anticipation of the regular disturbance detected. Suchcyclic obstacle detection modification can occur simultaneously withdynamic transient response of obstacle detection threshold levels, asotherwise described.

Alternative Incremental Encoding Implementions

Sensorless electronic sensing of motor current commutation pulses is thepreferred low cost method of motor rotor movement disclosed herein infair detail. In certain circumstances, it may be preferable to usealternative absolute and/or incremental position sensing by at least onehardware sensor means. Such circumstances that might lead to the choiceto implement position sensing via hardware sensors include: 1) desire tosense a greater number of encoder pulses per motor rotor revolution thanproduced by motor commutation segments to enable faster obstacledetection per time and/or per rotation; 2) high electrical noiseenvironment that makes it difficult to maintain high accuracy ofposition count from electronic sensing of encoder pulses; 3) actuatormechanisms that potentially allow mechanical windup and/or jitter thatmechanically feeds back to the motor rotor allowing production of rotorelectronic pulses representing ostensible actuator motion and/or motionin the incorrect sense; and 4) systems for which it is desired tomaintain strict position accuracy regardless of electrical noise andmechanical disturbances.

One particular general alternative preferred embodiment for incrementalpositioning sensing utilizes two sensing elements physically aligned toproduce phase quadrature signals from a relatively moving target. Twosensing elements in phase quadrature orientation provide informationabout both speed and direction. A typical example of this implementationis to attach a diametrically magnetized (two pole) magnet to the rotorof a motor with two symmetrical bipolar latch Hall effect sensors heldin 90 mechanical degrees and in proximity to sense the magnet. By thissetup, there are two transitions per Hall effect sensor per pole pair,thus a total of four transitions per motor rotor revolution by which totrigger measurements of motor operation parameters as herein describedwith motor current commutation pulse sensing. Alternatively, use of aring magnet having 10 pole pairs with similar symmetric bipolar latchHall effect sensors in phase quadrature will produce 40 transitions permotor rotor revolution.

Various sensing properties utilized for incremental and/or absoluteposition sensing including optical, magnetic field, electric field,potentiometric, and the like. Magnetic fields are sensed by Hall effect,magnetoresistance, anisotropic magnetoresistance, giantmagnetoresistance, collosal magnetoresistance, Wiegand effect, fluxgatemagnetometry, magnetodiode, magnetotransistor, superconducting quantuminterference magnetometry, and more. Electric fields are sensed byelectrodes of fixed and/or variable geometry with sensitive electroniccircuitry. Optical fields are sensed by photodiode, phototransistor,photoresistor, and thermocouple (for slowly changing fields converted toheat). Electromagnetic fields are sensed by electrodes as coupledantennas with tuned electronic circuitry.

Battery and Motor Protection

Battery voltage is monitored to determine when the power supply dropsbelow some minimum value so the motor drive can be discontinued. Thisprotects against battery rundown in the situation where a low voltagebattery power supply is insufficient to drive the motor and/or sustainedelectrical load might pose a risk of draining the battery. A timeouttimer to limit motor drive time is an additional preferred means bywhich similar protection is affected. Motor protection is optionallyprovided by such means as a current limiting diode, a positivetemperature coefficient resistor, and/or a thermal cutout switch.

Ice Breaking

An alternative functional capability is an ice-breaking mode wherebyfull motor force is allowed for more than the minimum amount of timeand/or distance to enable a window and/or sunroof panel to break loosefrom ice. This feature will be appreciated by many in cold climates whofind their car windows and/or sunroofs stuck in position due to ice. Forvisibility and/or escape safety, this option is fully anticipated as apreferred functional feature. For this optional mode of operation, thecontroller remembers the starting position for safety reference and willnot allow significant deviation therefrom if hard obstacle detectionconditions are sustained. Under manual switched input control, thecontroller allows for alternating direction application of full motorforce for some predetermined maximum distance and/or time, for examplethree millimeters and/or three seconds alternately in either directionbefore enabling hard obstacle detection capability. The characteristiccurrent peak and then drop usually occurs over approximately 10 motorcurrent commutation pulses, which corresponds to approximately 3 mm. IFstartup current deviates significantly above normal AND IF the number ofmotor current commutation pulses deviates significantly below 10 duringthe usual amount of time for a typical startup characteristic, THEN thestall timeout timer can be increased up to perhaps 5 seconds to breakice by a simple algorithm based upon the two deviations. Thereafter, ifnormal actuator motion does not commence by breaking loose from the ice,the actuator can then be retracted to remove hard obstacle preload andthe ice breaking cycle repeated. 3 mm is typically sufficient to breakice and also corresponds with the startup hard obstacle detectiondistance under conditions of obstacle preload. If the motor currentremains high and the number of pulses is normal at the characteristicstartup time, then a hard obstacle is determined. For safetyconsiderations, this feature might be enabled only when the sensedambient temperature is sufficiently cool to allow for the existence ofice conditions. Soft frozen ice might actually take a longer amount oftime and/or distance to break free than hard frozen ice, therenecessitating adjustment of the maximum set times and/or distances basedon sensed temperature. An alternate method of breaking ice can beenabled with a switch press sequence. For example, two taps and hold,then the unit can go into manual mode which disables obstructiondetection.

Timed Power Latch

An optional feature included in the preferred embodiment is for thecontroller to self latch power for an amount of time after the vehicleignition is switched off, for example 15 seconds, to allow the vehicleoperator to close the sunroof and/or windows. Likewise, another vehiclesecurity alternative is to allow the operator to select the option forthe vehicle sunroof and/or windows to automatically close when theignition is switched OFF. This feature can work in conjunction with analternative feature whereby the vehicle cabin temperature is sensed forthe automatic function of opening the sunroof and/or the windows to theVENT position when the sensed vehicle cabin temperature exceeds somemaximum set temperature. Similarly, a sunroof and/or window canautomatically close to the fully closed position when the sensed vehiclecabin temperature is below some set temperature. A reasonable hysteresisbetween the vent set temperature and the cool close temperature willreduce unnecessary cycling between VENT and CLOSED positions.

Vehicle Communication Systems

Communication motor vehicle computer via the vehicle communication busproblem is optional based upon interface system capability andapplication requirements. Examples of vehicle communication busesinclude SAE (Society of Automotive Engineers) J1850, CAN (ControllerArea Network), and numerous others developed by various automotivemanufacturers. Such communication means can communicate actuator systemfault conditions including faulty motor coil or commutator segment, lowactuation speed, excessive motor current, drive mechanism rangelimitation, component failures, system failures, and the like.

This vehicle speed information might be obtained by vehicle busmultiplexing (MUX) communication and/or demultiplexing (DEMUX)communication from such sources as speedometer, transmission, andtransfer case as is used by other sources such as cruise control system,anti-skid braking system, and traction control system. Similarly,information from the vehicle environmental control systems might provideinformation such as fan speeds and ventilation settings that can be ofvalue to anticipate an amount of static and transient loading on thesunroof and windows. Utilization of a relatively fast respondingpressure sensor enables empirically-correlative predictive modificationof obstacle detection thresholds to overcome variable changes ofactuator load due to static, periodic dynamic, and transient dynamicvehicle cabin atmospheric pressures. An optional anticipated feature isfor the vehicle sunroof position to be automatically moved to a positionto reduce sensed cabin wind buffeting and/or noise.

Empirical Actuation Motor Load Profile Equation and Algorithm

Nominal operation parameters for obstacle detection threshold areempirically characterized as motor current loading versus actuatorposition. Alternative empirical characterizations include motor currentversus time, motor speed versus time, motor speed versus position, andcombinations thereof as per prior art references. In the presentembodiment, this algebraic representation has a general simplifiedalgebraic form for fast computation via DSP processing, particularlyimplementing adding and/or bit shifting and/or byte shifting operations.These types of empirical data manipulations for conversion to fastcomputing real time microcontroller algorithms have been found to beapplicable to various diverse combinations of vehicles and sunroofs.

To accommodate each vehicle's fixed aerodynamic profile, it is typicallynecessary to empirically determine and characterize each type of vehiclewith each type of sunroof for each direction of opening and/or closingover a wide range of vehicle speed and temperature conditions todetermine all appropriate adaptive obstacle detection thresholdcalculation algorithms.

The present invention provides a system wherein empirical datarepresenting a range of operational conditions and empiricallydetermined functional terms and factors for an automatic poweredactuator can be converted by simplified piecewise line and/or curvefitting means to algorithmic equations with coefficients that supportfast real time processing such that adaptive sensing thresholds areenabled resulting in improved sensitivity, improved accuracy, andimproved time response to obstruction conditions. Based upon thecomplexity of the actuation system, sensitivity requirements, and timeresponse requirements, additional refinements as threshold errorreducing terms can be characterized for inclusion into the sensingthreshold equation using similar methods.

Utilization of simplified equations in the processing algorithms allowsfor fast performance in real time without relying upon previous methodssuch as using fixed characteristic signature templates and/or slowingdown actuator motor drive speed.

Alternative Applications

When used to operate a power sunroof the control circuit can open thesunroof, close the sunroof, and tilt open the sunroof to a ventposition. The preferred embodiment of the invention automaticallycontrols a power sunroof but similar actuation of other automaticpowered panels or windows is anticipated using the disclosed controlcircuit and obstruction detection methods.

Load sensing threshold determinations via similar methods to thisteaching are anticipated for alternative application functions includingthose without human involvement and for applications without potentialfor equipment damage. It is fully anticipated and expected that systemsand methods can well be similarly utilized to control practically anysystem variable by monitoring at least one operational parameter suchthat the controlled variable is not required to be safety related. Thismethod and system, based on empirical determinations of operatingparameters, running measurements of operating parameters, FIFO memoriesfor storing measured and/or calculated values, fast computationalgorithms, and subjective determination of load threshold parametervalues can generally be applied to systems and devices where suchvariable thresholds are chosen for functional means other than forpurposes of human safety or equipment protection. The large scopeincludes systems having more than one such controlled variable.

Aeronautical systems have applicability of the inventive disclosure. Anexample is the detection of the onset of stall conditions by the changein force and/or a cyclical varying lift produced by an airfoil as it isincreasingly approaching a stall condition. Such impending stallcondition is the sensed input, instead of obstacle detection, thatprecedes the control response to outputs including engine power, flapactuation, elevator actuation, aileron actuation, rudder actuation, iceboot actuation, and the like. Analogously, hydraulic liquid flow controlsystems for ships and submarines are anticipated.

Hydraulic, pneumatic, and mechanical systems are similarly anticipatedby computations based upon time, position, and/or other derivatives ofmonitored parameters including: position, pressure, volume, flow, force,torque and the like. Utilization of analogous algorithms and adaptivemethods and systems enables obstacle detection, and/or arbitraryfunctional limit detections

Broad Encompassed Alternatives

While the present invention has been described with a degree ofparticularity, it is the full intent that the invention includemodifications and altercations from the disclosed and anticipateddesigns falling within the spirit and/or scope of the appended claims.

1. Apparatus for controlling activation of a motor coupled to a motorvehicle window or panel for moving said window or panel along a travelpath and de-activating the motor if an obstacle is encountered by thewindow or panel, said apparatus comprising: a) a sensor for sensingmovement of the window or panel and providing a sensor output signalrelated to a speed of movement of the window or panel; b) a switch forcontrollably actuating the motor by providing an energization signal; c)one or more switches for use by the controller to determine window orpanel position; and d) a controller having an interface coupled to thesensor and the switch for controllably energizing the motor; saidcontroller sensing a collision with an obstruction when power is appliedto the controller by: i) monitoring movement of the window or panel bymonitoring a signal from the sensor related to the movement of thewindow or panel; ii) adjusting an obstacle detection threshold in realtime based on immediate past measurements of the signal sensed by thesensor to adapt to varying conditions encountered during operation ofthe window or panel; iii) identifying a collision of the window or panelwith an obstacle due to a change in the signal from the sensor that isrelated to a change in movement of the window or panel by comparing avalue based on a most recent signal from the sensor with the obstacledetection threshold; and iv) outputting a control signal to said switchto deactivate said motor in response to a sensing of a collision betweenan obstacle and said window or panel.
 2. The apparatus of claim 1wherein the controller comprises a programmable controller including aprocessing unit for executing a control program and including a memoryfor storing multiple window or panel speed values corresponding to asignal received from the sensor.
 3. The apparatus of claim 1 wherein thecontroller maintains a position of a leading edge of the window or paneland further wherein the controller reverse energizes the motor to movethe window or panel away from a closure position prior to activating themotor to close the window or panel.
 4. The apparatus of claim 3 whereinthe controller reverse energizes the motor in response to a sensing ofan obstacle and the reverse energizing and attempt to move the window orpanel to a closed position is performed to confirm sensing of theobstacle.
 5. The apparatus of claim 1 wherein the immediate pastmeasurements of said signal are sensed within a forty millisecondinterval prior to the most recent signal from the sensor.
 6. Apparatusfor controlling activation of a motor coupled to a motor vehicle windowor panel for moving said window or panel along a travel path andde-activating the motor when movement of the window or panel is stoppedprior to reaching a predetermined position, said apparatus comprising:a) a sensor for sensing movement of the window or panel and providing asensor output signal related to a position of the window or panel; b) aswitch for controllably actuating the motor by providing an energizationsignal; and c) a controller having an interface coupled to the sensorand the switch for controllably energizing the motor; said controllerprogrammed with multiple position limits that define an acceptabletravel range and further programmed for controlling movement of thewindow or panel when power is applied to the controller by: i)monitoring the sensor output signal from the sensor related to theposition of the window or panel; ii) identifying the position of thewindow or panel based on the sensor output signal from the sensor; andiii) outputting a control signal to said switch to deactivate said motorin response to a sensing said window or panel has stopped moving priorto reaching a position limit.
 7. The apparatus of claim 6 wherein thecontroller comprises a programmable controller including a processingunit for executing a control program and including a memory for storingmultiple window or panel position values corresponding to a signalreceived from the sensor.
 8. The apparatus of claim 6 additionallycomprising one or more position limits programmed for use by thecontroller to determine window or panel position for use in identifyingwhether the window or panel is closed or open.
 9. The apparatus of claim6 wherein the controller maintains a position of a leading edge of thewindow or panel and further wherein the controller reverse energizes themotor to move the window or panel away from a closure position prior toactivating the motor to close the window or panel.
 10. The apparatus ofclaim 6 wherein the controller includes an interface for monitoring useractuation of control inputs for controlling movement of the motorvehicle window or panel and wherein the controller maintain a positionindication which is updated in response to movement of the window orpanel and further wherein the controller reverse actuates the motor nearan end point in the travel path of the window or panel to avoid falseobstacle detection in a region of closure of the window or panel.